﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestroyPoolObject : MonoBehaviour {
    [HideInInspector]
    public ObjectPool objectPool;
    [Header("判断这是时间加条件模式（子弹或炮弹等）还是条件模式（玩家或敌人）")]
    public bool isCondition = true;
    [Header("对象的销毁时间/禁用时间（生周）")]
    public float destroyTime;

	void OnEnable () {
        Invoke("DisableObject", destroyTime);
    }
    void DisableObject() //禁用对象或者销毁对象
    {
        objectPool.ReturnObjcet(gameObject);
    }
}
